package com.github.cdisk.xtrans.ui.toolbox;

import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.widgets.Composite;

import com.github.cdisk.xtrans.ui.Operation;

/**
 * 目前画布中所有的元件对象列表
 * @author cdisk
 *
 */
public class ObjectListBox extends org.eclipse.swt.widgets.List {


	public ObjectListBox(Composite parent, int style) {
		super(parent, style);
	}

	public void reflushItems() {
		String[] items = new String[Operation.CONFIG.components.size()];
		for (int i = 0; i < items.length; i++) {
			items[i] = Operation.CONFIG.components.get(i).getId();
		}
		this.setItems(items);
	}

	@Override
	public boolean print(GC gc) {
		reflushItems();
		return super.print(gc);
	}

	@Override
	protected void checkSubclass() {
	}
}
